<?php
include_once('king_head.php');
if($action=="Save")
{		
		$title=mysql_escape_string($title);
		$fname=mysql_escape_string($fname);
		$mname=mysql_escape_string($mname);
		$lname=mysql_escape_string($lname);
		$email=mysql_escape_string($email);				
		$phone_no=mysql_escape_string($phone_no);
		$business_no=mysql_escape_string($business_no);
		$mobile_no=mysql_escape_string($mobile_no);
		$business_name=mysql_escape_string($business_name);
		$business_type=mysql_escape_string($business_type);
		$emp_pos=mysql_escape_string($emp_pos);
		$address1=mysql_escape_string($address1);
		$address2=mysql_escape_string($address2);
		$suite=mysql_escape_string($suite);
		$URL=mysql_escape_string($URL);		
		$city=mysql_escape_string($city);		
		$province=mysql_escape_string($province);
		$country=mysql_escape_string($country);
$qry="UPDATE reseller SET title='$title', fname='$fname', lname='$lname', mname='$mname', email='$email', phone_no='$phone_no', mobile_no='$mobile_no', business_no='$business_no', business_type='$business_type', business_name='$business_name', emp_pos='$emp_pos', address1='$address1', address2='$address2', suite='$suite', city='$city', province='$province', country='$country', zip='$zip' WHERE site_id=".$_SESSION['SITE_ID'];
mysql_query($qry);
echo"<h4><font color=\"red\">Reseller Information Updated!!</font></h4>";
}

$sql="SELECT * FROM reseller WHERE site_id=".$_SESSION['SITE_ID'];
$res=mysql_query($sql);
$row=mysql_fetch_array($res);
?>
<form name="frm" action="reseller_edit.php?site_id=<?php echo $_SESSION['SITE_ID'];?>" method="post">
				    <table width="386" border="0">
                      <tr>
                        <td height="48" colspan="2"><h2 align="center">Edit Personal Information </h2></td>
                      </tr>
                      <tr>
                        <td width="134">Title</td>
                        <td width="242"><input type="text" name="title" value="<?php echo $row['title'];?>"/></td>
                      </tr>
                      <tr>
                        <td>First Name </td>
                        <td><input type="text" name="fname" value="<?php echo $row['fname'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Middle Name </td>
                        <td><input type="text" name="mname" value="<?php echo $row['mname'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Last Name </td>
                        <td><input type="text" name="lname" value="<?php echo $row['lname'];?>"/></td>
                      </tr>
                      <tr>
                        <td>E-mail</td>
                        <td><input type="text" name="email" value="<?php echo $row['email'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Phone No. </td>
                        <td><input type="text" name="phone_no" value="<?php echo $row['phone_no'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Business No. </td>
                        <td><input type="text" name="business_no" value="<?php echo $row['business_no'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Mobile No. </td>
                        <td><input type="text" name="mobile_no" value="<?php echo $row['mobile_no'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Business Name </td>
                        <td><input type="text" name="business_name" value="<?php echo $row['business_name'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Business Type </td>
                        <td><input type="text" name="business_type" value="<?php echo $row['business_type'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Employment Position </td>
                        <td><input type="text" name="emp_pos" value="<?php echo $row['emp_pos'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Street Address1 </td>
                        <td>
                        <textarea name="address1" cols="40" rows="4"><?php echo $row['address1'];?> </textarea></td>
                      </tr>
                      <tr>
                        <td>Street Address2 </td>
                        <td><textarea name="address2" cols="40" rows="4"><?php echo $row['address2'];?> </textarea></td>
                      </tr>
                      <tr>
                        <td>Suite</td>
                        <td><input type="text" name="suite" value="<?php echo $row['suite'];?>"/></td>
                      </tr>
                      <tr>
                        <td>City</td>
                        <td><input type="text" name="city" value="<?php echo $row['city'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Province</td>
                        <td><input type="text" name="province" value="<?php echo $row['province'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Country</td>
                        <td><input type="text" name="country" value="<?php echo $row['country'];?>"/></td>
                      </tr>
                      <tr>
                        <td>Zip Code </td>
                        <td><input type="text" name="zip" value="<?php echo $row['zip'];?>"/></td>
                      </tr>
					  <tr>
                        <td>URL </td>
                        <td><input type="text" name="URL" value="<?php echo $row['URL'];?>"/></td>
                      </tr>
                      <tr>
                        <td colspan="2"><div align="center">
                          <input type="submit" name="action" value="Save" />
                        </div></td>
                      </tr>
                    </table>
</form>
<?php
include_once('king_foot.php');
?>